﻿using System;

namespace Mojo
{
    public class Event
    {
        public const string command = string.Empty;
        public const string commandEnable = string.Empty;
        public const string propertyChange = string.Empty;
        public const string listChange = string.Empty;
        public const string aboutToActivate = string.Empty;
        public const string activate = string.Empty;
        public const string back = string.Empty;
        public const string dragEnd = string.Empty;
        public const string dragging = string.Empty;
        public const string dragStart = string.Empty;
        public const string filter = string.Empty;
        public const string filterImmediate = string.Empty;
        public const string flick = string.Empty;
        public const string forward = string.Empty;
        public const string hold = string.Empty;
        public const string holdEnd = string.Empty;
        public const string imageViewChanged = string.Empty;
        public const string keydown = string.Empty;
        public const string keypress = string.Empty;
        public const string keyup = string.Empty;
        public const string listAdd = string.Empty;
        public const string listDelete = string.Empty;
        public const string listReorder = string.Empty;
        public const string listTap = string.Empty;
        public const string orientationChange = string.Empty;
        public const string progressComplete = string.Empty;
        public const string progressIconTap = string.Empty;
        public const string scrollStarting = string.Empty;
        public const string singleTap = string.Empty;
        public const string sliderDragEnd = string.Empty;
        public const string sliderDragStart = string.Empty;
        public const string stageActivate = string.Empty;
        public const string stageDeactivate = string.Empty;
        public const string tap = string.Empty;
        public const string webViewImageSaved = string.Empty;

        public readonly string type;

        //Note:Upcase 1st letter to avoid conflict with the static member
        public string Command;
        public void StopPropagation()
        {
        }

        /// <summary>
        /// A wrapper around addEventListener that adds some parameter checking.
        /// </summary>
        /// <param name="target">target to observe</param>
        /// <param name="evtType">type of the event to observe</param>
        /// <param name="handlerFunction">function to call when the event fires</param>        
        public static void Listen(object target, string evtType, Delegate handlerFunction)
        {
        }

        /// <summary>
        /// A wrapper around addEventListener that adds some parameter checking.
        /// </summary>
        /// <param name="target">target to observe</param>
        /// <param name="evtType">type of the event to observe</param>
        /// <param name="handlerFunction">function to call when the event fires</param>
        /// <param name="useCapture">optional parameter that, when true, causes the event to be observed during the capture phase.</param>
        public static void Listen(object target, string evtType, Delegate handlerFunction, bool useCapture)
        {
        }

        /// <summary>
        /// A wrapper around removeEventListener that adds some parameter checking.
        /// </summary>
        /// <param name="target">target to observe.</param>
        /// <param name="evtType">type of the event that was being observed.</param>
        /// <param name="handlerFunction">function that was previously passed to listen.</param>        
        public static void StopListening(object target, string evtType, Delegate handlerFunction)
        {
        }

        /// <summary>
        /// A wrapper around removeEventListener that adds some parameter checking.
        /// </summary>
        /// <param name="target">target to observe.</param>
        /// <param name="evtType">type of the event that was being observed.</param>
        /// <param name="handlerFunction">function that was previously passed to listen.</param>
        /// <param name="useCapture">optional parameter that, when true, causes a capture phase listener to be removed.</param>
        public static void StopListening(object target, string evtType, Delegate handlerFunction, bool useCapture)
        {
        }

        //TODO:
        /*
        Mojo.Event.listenForFocusChanges(node, handler)
        Mojo.Event.listenForHoldEvent(node, downEvent, upEvent, handler, timeout)
        Mojo.Event.make(name{string}, details, optionalDocument, optionalBubbles, optionaCancel)
        Mojo.Event.send(element, name{string}, mojoDetails, optionalBubbles, optionaCancel)
        Mojo.Event.sendKeyDownAndUpEvents(keyDescription, optionalDocument)
        Mojo.Event.sendKeyEvent(keyDescription, optionalEventType, optionalDocument)
        */
    }
}
